
var title = document.title.split(" - ",1);
var title1 = title[0];

function sinaweibo(){
	window.open("http://v.t.sina.com.cn/share/share.php?title=" + encodeURIComponent(title1) + "&url="+encodeURIComponent(location.href)+"&source=bookmark&appkey=3063520215&ralateUid=1930665641",'_blank','width=615,height=500');
}
function sharetui(){
	window.open("http://twitter.com/share?text=" + encodeURIComponent(title1) + "&url=" + encodeURIComponent(location.href) + "&via=macidea",'_blank','width=615,height=500');
}
function shareren(){
	window.open("http://www.connect.renren.com/share/sharer?url=" +  encodeURIComponent(location.href)  + "&title=" +encodeURIComponent(title1),'_blank','width=615,height=500');
}
function sharefb(){
	window.open("http://www.facebook.com/sharer.php?u=" + encodeURIComponent(location.href) + "&t=" + encodeURIComponent(title1),'_blank','width=626,height=436');
}

jQuery(function(){
	jQuery(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 7, delay:200});
	jQuery(".ranknode img").tipTip({maxWidth: "auto", edgeOffset: 7, delay:200});
	jQuery(".tooltiptop").tipTip({maxWidth: "auto", edgeOffset: 7, delay:100, defaultPosition:"top"});
	jQuery(".searchtip").tipTip({maxWidth: "auto", defaultPosition:"right", activation:"focus", edgeOffset: 15, delay:100,content:"Google 搜索" });
	jQuery(".postbtn").tipTip({maxWidth: "auto",  edgeOffset: 7, delay:100,defaultPosition:"top",content:"提问／发布资源前请先搜索" });
	jQuery(".popupmenu").tipTip({maxWidth: "auto", edgeOffset: 7, delay:0, keepAlive: "true", content: "<a href='#' target='_blank'>Twitter</a><br/><a href='https://www.facebook.com/pages/DzWind-Sclub-Plugin/145774675527934' target='_blank'>Facebook</a>"});
	jQuery(".memcp").tipTip({maxWidth: "auto", edgeOffset: 7, delay:0, keepAlive: "true", content: "<a href='memcp.php'>修改资料</a><br/><a href='memcp.php?action=profile&typeid=1'>修改密码</a><br/><a href='magic.php'>购买道具</a><br/><a href='medal.php'>申请勋章</a><br/><a href='memcp.php?action=usergroups'>权限信息</a><br/><a href='thread-2014-1-1.html'>积分信息</a>"});
	jQuery(".uidtip").tipTip({maxWidth: "auto", edgeOffset: 7, delay:0, keepAlive: "true", content: "<a href='my.php?item=threads'>我的帖子</a><br/><a href='my.php?item=buddylist&'>我的好友</a><br/><a href='my.php?item=favorites&type=thread'>我的收藏</a><br/><a href='my.php?item=subscriptions'>我的订阅</a><br/><a href='task.php'>我的任务</a><br/><a href='memcp.php?action=profile&typeid=5'>我的设定</a>"});
	jQuery(".threadmenu").tipTip({maxWidth: "auto", edgeOffset: 7, delay:0, keepAlive: "true", content: "<a href='my.php?item=threads'>查看主题状态</a><br/><a href='my.php?item=posts'>查看回复状态</a>"});
	jQuery(".weiboshare").tipTip({maxWidth: "auto", edgeOffset: 7, delay:0, keepAlive: "true", content: "<a href='javascript:sinaweibo()'>新浪微博</a><br/><a href='javascript:shareren()'>人人网</a><br/><a href='javascript:sharetui()'>Twitter</a><br/><a href='javascript:sharefb()'>Facebook</a>"});
});
jQuery(document).ready(function(){
	var first = 0;var speed = 700;var pause = 3500;
		function removeFirst(){
			first = jQuery('ul#newstopics li:first').html();
			jQuery('ul#newstopics li:first')
			.animate({opacity: 0}, speed)
			.fadeOut('slow', function() {jQuery(this).remove();});
			addLast(first);
		}
		function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			jQuery('ul#newstopics').append(last)
			jQuery('ul#newstopics li:last')
			.animate({opacity: 1}, speed)
			.fadeIn('slow')
		}
	interval = setInterval(removeFirst, pause);
});
